/*
 * Famon (http://code.google.com/p/famon/)
 * Copyright (c) 2010 Carl Crous.
 *
 * This file is part of Famon.
 *
 * Famon is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Famon is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Famon.  If not, see <http://www.gnu.org/licenses/>.
 */

package za.org.foobar.famon.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 *
 */
public class CFailureBatch implements Serializable {
    // If the major version number changes, the client and server are no longer compatible.
    public static final String FAMON_PROTOCOL_VERSION = "1.0";
    public static final char FAMON_PROTOCOL_VERSION_SEPARATOR = ';';

    // The protocol's version number
    private String protocolVersion;
    // The application's name
    private String application;
    // The application version string
    private String version;
    // The application's instance name
    private String instance;
    // The sending machine's ip address
    private String sourceAddress;
    // The sending machine's hostname
    private String sourceHostname;
    // The failures
    private List<CFailure> failures;

    public CFailureBatch() {
        protocolVersion = FAMON_PROTOCOL_VERSION;
        failures = new ArrayList<CFailure>();
    }

    public String getProtocolVersion() {
        return protocolVersion;
    }

    public void setProtocolVersion(String protocolVersion) {
        this.protocolVersion = protocolVersion;
    }

    public String getApplication() {
        return application;
    }

    public void setApplication(String application) {
        this.application = application;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getInstance() {
        return instance;
    }

    public void setInstance(String instance) {
        this.instance = instance;
    }

    public String getSourceAddress() {
        return sourceAddress;
    }

    public void setSourceAddress(String sourceAddress) {
        this.sourceAddress = sourceAddress;
    }

    public String getSourceHostname() {
        return sourceHostname;
    }

    public void setSourceHostname(String sourceHostname) {
        this.sourceHostname = sourceHostname;
    }

    public List<CFailure> getFailures() {
        return failures;
    }

    public void setFailures(List<CFailure> failures) {
        this.failures = failures;
    }

    public void addFailure(CFailure failure) {
        failures.add(failure);
    }

    public void clearFailures() {
        failures.clear();
    }
}
